/*
 * @Author: AI Assistant
 * @Date: 2024-12-19
 * @Description: 公司信息模型
 */
import { ApiProperty } from '@nestjs/swagger';
import { modelOptions, prop } from '@typegoose/typegoose';
import { IsNotEmpty, IsOptional, Allow } from 'class-validator';

@modelOptions({
  // 自动为每个属性添加时间戳
  schemaOptions: {
    timestamps: true,
  },
})
export class CompanyInfo {
  @ApiProperty({ description: '公司名称' })
  @IsNotEmpty({ message: '公司名称不能为空' })
  @prop()
  companyName: string;

  @ApiProperty({ description: '公司地址' })
  @IsOptional()
  @prop()
  companyAddress: string;

  @ApiProperty({ description: '公司介绍简述' })
  @IsOptional()
  @prop()
  companyDescription: string;

  @ApiProperty({ description: '邮政编码' })
  @IsOptional()
  @prop()
  postalCode: string;

  @ApiProperty({ description: '联系人' })
  @IsOptional()
  @prop()
  contactPerson: string;

  @ApiProperty({ description: '手机号' })
  @IsOptional()
  @prop()
  mobilePhone: string;

  @ApiProperty({ description: '电话号' })
  @IsOptional()
  @prop()
  telephone: string;

  @ApiProperty({ description: '传真' })
  @IsOptional()
  @prop()
  fax: string;

  @ApiProperty({ description: '电子邮箱' })
  @IsOptional()
  @prop()
  email: string;

  @ApiProperty({ description: 'QQ号码' })
  @IsOptional()
  @prop()
  qqNumber: string;

  @ApiProperty({ description: '微信二维码地址' })
  @IsOptional()
  @prop()
  wechatQrCodeUrl: string;

  @ApiProperty({ description: '公众号二维码地址' })
  @IsOptional()
  @prop()
  officialAccountQrCodeUrl: string;

  @ApiProperty({ description: '营业执照' })
  @IsOptional()
  @prop()
  businessLicense: string;

  @ApiProperty({ description: '营业执照副本' })
  @IsOptional()
  @prop()
  businessLicenseCopy: string;

  @ApiProperty({ description: '其他信息' })
  @IsOptional()
  @prop()
  otherInfo: string;

  @Allow()
  createdAt: string;

  @Allow()
  updatedAt: string;

  @Allow()
  __v: string;
}